#!/usr/bin/sh

fin=`./random 1 9`
k=0
for ((i=0;i<5;i++))
do

    for ((j=0;j<3;j++))
    do
	echo "请输入一个数："
	read m
	if [ $m -eq $fin ];then
	    echo "恭喜！你猜中了"
	    k=$(($k+1))
	    break;
	elif [ $m -gt $fin ];then
	    echo "大于目的数"
	elif [ $m -lt $fin ];then
	    echo "小于目的数"
	 
	fi
    done
done
	echo "共得分$k"
